# -*- coding: utf-8 -*-

import warnings

import pandas as pd
from sklearn.decomposition import PCA
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis

from ..base import CommonFunction


class FeatureReduction(CommonFunction):
    def PCA(self, n_components='mle', whiten=False, svd_solver='auto'):
        pca = PCA(n_components=n_components, whiten=whiten, svd_solver=svd_solver)
        self._data = pd.DataFrame(pca.fit_transform(self._data))
        return pca

    def LDA(self, solver='svd', shrinkage=None, n_components=None):
        lda = LinearDiscriminantAnalysis(solver=solver, shrinkage=shrinkage, n_components=n_components)
        self._data = pd.DataFrame(lda.fit_transform(self._data))
        return lda

    def SVD(self):
        # TODO
        pass

    def clustering(self):
        # TODO
        pass
